package com.stars.questions.deptQuestion.init.controller;

import com.stars.base.entity.Result;
import com.stars.questions.deptQuestion.init.service.InitService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : Rocks
 * @version : 1.0
 * @date : 2022/12/3 23:13
 * @description : 数据初始化控制器
 */
@RestController
@RequestMapping("/init")
public class InitController {

    private final InitService service;

    public InitController(InitService service) {
        this.service = service;
    }

    @RequestMapping("/reply")
    public Result initReply(int count) {
        if(count<1){
            return Result.error("请输入正确的初始化数量！");
        }
        return Result.result(service.initReply(count));
    }

}
